<blockquote>
    <p>数据库脚本</p>
    <footer>项目有时候会遇见脚本修复数据的情况, 如下可以快速操作数据库</code>
    </footer>
</blockquote>
<blockquote>
    <p>示例 采用配置</p>
</blockquote>
<pre class="code brush:plain">
### 数据库连接 ###
ants.db.driver-class-name=com.mysql.jdbc.Driver
ants.db.url = jdbc:mysql://ali.mysql.com:3306/idle_egg?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&tinyInt1isBit=false
ants.db.username = root
ants.db.password = ants666
ants.db.data-source = druid
</pre>
<blockquote>
    <p>示例</p>
    <footer>默认是Durid数据源, 操作和DbUtils差不多</footer>
</blockquote>
<pre class="code brush:java">
package cn.jants.demos;


import cn.jants.common.bean.JsonMap;
import cn.jants.common.bean.Prop;
import cn.jants.core.context.AppConfiguration;
import cn.jants.plugin.db.Db;

import java.util.List;


/**
 * 默认是Durid数据源, 操作和DbUtils差不多
 *
 * @author MrShun
 * @version 1.0
 * @Date 2017/12/20
 */

public class DemosApplication {


    public static void main(String[] args) {
        //加载配置
        Prop.use("application.properties");
        Db db = new Db();
        List&lt;JsonMap> members = db.list("select * from member");
        //迭代所有会员信息
        for (JsonMap member : members) {
            System.out.println(member);
        }
    }
}
</pre>
<script type="text/javascript">
    $(function () {
        SyntaxHighlighter.highlight();
        $(".toolbar").remove();
    });
</script>